package ii.zjf.week4.count;

import java.util.concurrent.Semaphore;

public class Add8 extends BaseAdd {

    public static void main(String[] args) throws InterruptedException {

        final Semaphore semaphore = new Semaphore(0);

        Thread thread = new Thread(() -> {
            count.add();
            semaphore.release();
        });

        thread.start();

        semaphore.acquire();

        System.out.println("success : " + count.getCount());

    }
}
